package com.manager.util;

import javax.servlet.ServletContext;
/*
 * 这里存储的都是不变的数据
 */
public class CONSTANT {
	//--------------------------- 启动时，从config.properites加载的参数 ---------------------------
	//存储servletContext，可以获取通用服务
	public static ServletContext SERVLET_CONTEXT;
	
	//重置的密码
	public static String RESET_PASSWORD;
	
	//分页时，每页的记录数
	public static int PAGE_SIZE;
	
	//邮件发送服务器设置
	public static final class MAIL_SERVER_CONFIG {
		public static String HOST;
		public static String PORT;
		public static boolean VALIDATE;
		public static String USERNAME;
		public static String PASSWORD;
		public static String FROM_ADDRESS;
	}
	
	
	//--------------------------- 固定参数 ---------------------------
	//登录后保存的session
	public static final String SESSION_KEY = "loginUser";
	
	//kapacha验证码在session中的key
	public static final String KAPTCHA_SESSION_KEY = com.google.code.kaptcha.Constants.KAPTCHA_SESSION_KEY;
	
	//递归循环最大次数，防止无限递归
	public static final int MAX_RECURSIVE = 100;

	//已登录, 禁止访问的URL后缀
	public static final String[] RED_URL_SUFFIX = {
		".jsp",
		".html"
	};
	
	//未登录, 放行的URL
	public static final String[] GREEN_URL = {
		"",//请求根路径
		"/",//请求根路径
		"index.jsp",
		"login.jsp",
		"test.jsp",
		"firewall.jsp",
		"alert404.jsp",
		"commonAction!forward.ac",
		"sysLoginAction!queryLogin.ac",
		"sysLoginAction!queryLoginOff.ac",
		"sysLoginAction!querySessionTimeout.ac",
		"sysLoginAction!addTest.ac"
	};
	
}
